🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / feature / node / src / commonMain / kotlin / org / meshtastic / feature / node / component / NodeCountSummaryPreviews.kt
Displaying Raw • Download
feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/component/NodeCountSummaryPreviews.kt d9b9ce6e8a43ada377ba1e6196d3d3352de20168 (d9b9ce6e) Text, 3.72 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tf0883e@fileTb4b4b4:Te6edf3SuppressTb4b4b4(Ta5d6ff"Ta5d6ffMagicNumberTa5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ffPreviewPublicTa5d6ff"Tb4b4b4)
Tff7b72package T7ee787org.meshtastic.feature.node.component
Tff7b72import T7ee787androidx.compose.foundation.layout.fillMaxWidth
Tff7b72import T7ee787androidx.compose.foundation.layout.padding
Tff7b72import T7ee787androidx.compose.material3.MaterialTheme
Tff7b72import T7ee787androidx.compose.material3.Surface
Tff7b72import T7ee787androidx.compose.runtime.Composable
Tff7b72import T7ee787androidx.compose.ui.Modifier
Tff7b72import T7ee787androidx.compose.ui.tooling.preview.Preview
Tff7b72import T7ee787androidx.compose.ui.unit.dp
Tff7b72import T7ee787org.meshtastic.core.ui.theme.AppTheme
T8b949e/** English labels matching the counts from issue #6268 (76 online / 398 shown / 1247 total). */
Tff7b72private Tff7b72val Te6edf3ENGLISH_LABELS Tff7b72= Te6edf3listOfTb4b4b4(Ta5d6ff"Ta5d6ff76 onlineTa5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff398 shownTa5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff1247 totalTa5d6ff"Tb4b4b4)
T8b949e/**
* Deliberately verbose stand-ins for the longest Crowdin locales (German/Hungarian style compounds run roughly twice
* the English width). Hard-coded rather than locale-switched so the preview does not depend on a translated bundle.
*/
Tff7b72private Tff7b72val Te6edf3LONG_LOCALE_LABELS Tff7b72= Te6edf3listOfTb4b4b4(Ta5d6ff"Ta5d6ff76 Knoten verbundenTa5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff398 Knoten angezeigtTa5d6ff"Tb4b4b4, Ta5d6ff"Ta5d6ff1247 Knoten insgesamtTa5d6ff"Tb4b4b4)
Tff7b72private Tff7b72const Tff7b72val Te6edf3ENGLISH_DESCRIPTION Tff7b72= Ta5d6ff"Ta5d6ff(76 online / 398 shown / 1247 total)Ta5d6ff"
Tf0883e@Composable
Tff7b72private Tff7b72fun Td2a8ffPreviewBodyTb4b4b4(Te6edf3labelsTb4b4b4: Te6edf3ListTff7b72<Tffa657StringTff7b72>Tb4b4b4, Te6edf3descriptionTb4b4b4: Tffa657StringTb4b4b4) Tb4b4b4{
Te6edf3AppTheme Tb4b4b4{
Te6edf3SurfaceTb4b4b4(Te6edf3color Tff7b72= Te6edf3MaterialThemeTb4b4b4.Te6edf3colorSchemeTb4b4b4.Te6edf3surfaceDimTb4b4b4) Tb4b4b4{
Te6edf3NodeCountSummaryContentTb4b4b4(
Te6edf3labels Tff7b72= Te6edf3labelsTb4b4b4,
Te6edf3contentDescription Tff7b72= Te6edf3descriptionTb4b4b4,
Te6edf3modifier Tff7b72= Te6edf3ModifierTb4b4b4.Te6edf3fillMaxWidthTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3paddingTb4b4b4(T79c0ff1T79c0ff2.Te6edf3dpTb4b4b4)Tb4b4b4,
Tb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tb4b4b4}
T8b949e/** Default case on a narrow (compact-width) phone. */
Tf0883e@PreviewTb4b4b4(Te6edf3name Tff7b72= Ta5d6ff"Ta5d6ffNodeCountSummary - defaultTa5d6ff"Tb4b4b4, Te6edf3widthDp Tff7b72= T79c0ff3T79c0ff6T79c0ff0Tb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffNodeCountSummaryDefaultPreviewTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3PreviewBodyTb4b4b4(Te6edf3ENGLISH_LABELSTb4b4b4, Te6edf3ENGLISH_DESCRIPTIONTb4b4b4)
Tb4b4b4}
T8b949e/** Narrowest realistic phone width — labels must reflow, never ellipsize. */
Tf0883e@PreviewTb4b4b4(Te6edf3name Tff7b72= Ta5d6ff"Ta5d6ffNodeCountSummary - narrow 320dpTa5d6ff"Tb4b4b4, Te6edf3widthDp Tff7b72= T79c0ff3T79c0ff2T79c0ff0Tb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffNodeCountSummaryNarrowPreviewTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3PreviewBodyTb4b4b4(Te6edf3ENGLISH_LABELSTb4b4b4, Te6edf3ENGLISH_DESCRIPTIONTb4b4b4)
Tb4b4b4}
T8b949e/** Long/translated text: verbose locale on a narrow phone. */
Tf0883e@PreviewTb4b4b4(Te6edf3name Tff7b72= Ta5d6ff"Ta5d6ffNodeCountSummary - long localeTa5d6ff"Tb4b4b4, Te6edf3widthDp Tff7b72= T79c0ff3T79c0ff2T79c0ff0Tb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffNodeCountSummaryLongLocalePreviewTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3PreviewBodyTb4b4b4(Te6edf3LONG_LOCALE_LABELSTb4b4b4, Te6edf3ENGLISH_DESCRIPTIONTb4b4b4)
Tb4b4b4}
T8b949e/** Accessibility text size: largest Android font scale. */
Tf0883e@PreviewTb4b4b4(Te6edf3name Tff7b72= Ta5d6ff"Ta5d6ffNodeCountSummary - font scale 2xTa5d6ff"Tb4b4b4, Te6edf3widthDp Tff7b72= T79c0ff3T79c0ff6T79c0ff0Tb4b4b4, Te6edf3fontScale Tff7b72= T79c0ff2.0fTb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffNodeCountSummaryLargeFontPreviewTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3PreviewBodyTb4b4b4(Te6edf3ENGLISH_LABELSTb4b4b4, Te6edf3ENGLISH_DESCRIPTIONTb4b4b4)
Tb4b4b4}
T8b949e/** Worst case: verbose locale AND largest font scale on a narrow phone. */
Tf0883e@PreviewTb4b4b4(Te6edf3name Tff7b72= Ta5d6ff"Ta5d6ffNodeCountSummary - long locale font scale 2xTa5d6ff"Tb4b4b4, Te6edf3widthDp Tff7b72= T79c0ff3T79c0ff2T79c0ff0Tb4b4b4, Te6edf3fontScale Tff7b72= T79c0ff2.0fTb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffNodeCountSummaryLongLocaleLargeFontPreviewTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3PreviewBodyTb4b4b4(Te6edf3LONG_LOCALE_LABELSTb4b4b4, Te6edf3ENGLISH_DESCRIPTIONTb4b4b4)
Tb4b4b4}
T8b949e/** Wide/tablet layout — the labels stay on one line and the block does not stretch awkwardly. */
Tf0883e@PreviewTb4b4b4(Te6edf3name Tff7b72= Ta5d6ff"Ta5d6ffNodeCountSummary - wide 840dpTa5d6ff"Tb4b4b4, Te6edf3widthDp Tff7b72= T79c0ff8T79c0ff4T79c0ff0Tb4b4b4)
Tf0883e@Composable
Tff7b72fun Td2a8ffNodeCountSummaryWidePreviewTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3PreviewBodyTb4b4b4(Te6edf3ENGLISH_LABELSTb4b4b4, Te6edf3ENGLISH_DESCRIPTIONTb4b4b4)
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s